<?php

class Adept_Validate_Exception extends Adept_Exception 
{
    
    public function __construct($message, $code = 0, $params = array()) 
    {
        parent::__construct($message, $code, $params);
    }    
    
    public function getLocalizedMessage() 
    {
        $message = Adept_L10n_Bundle::getInstance()->get($this->getMessage(), 'validate');
        foreach ($this->params as $param => $value) {
            $message = str_replace('{$' . $param . '}', $value, $message);
        }
        return $message;
    }    
    
}